/* ===============================
   FINCHI Order Modal – Premium
   =============================== */

/* ===============================
   Cross-platform normalization
   =============================== */

.finchi-modal *,
.finchi-modal *::before,
.finchi-modal *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.finchi-modal {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.finchi-modal[hidden] {
  display: none;
}

.finchi-modal {
  position: fixed;
  inset: 0;
  z-index: 40000;
  display: grid;
  place-items: start center; /* NE középre, hanem felülre (header alá) */
  padding: 16px; /* ezt később felülírja a safe-area blokk */
  font-family: inherit;
}

/* ---------- Backdrop ---------- */
.finchi-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

/* ---------- Panel ---------- */
.finchi-modal__panel {
  position: relative;
  width: min(520px, 100%);
  background:
    radial-gradient(
      120% 120% at 10% 0%,
      rgba(255, 215, 140, 0.06),
      transparent 40%
    ),
    #0b0b0f;
  border-radius: 18px;
  border: 1px solid rgba(255, 215, 140, 0.18);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #ffffff;
  overflow: hidden;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Header ---------- */
.finchi-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 215, 140, 0.15);
}

.finchi-modal__brand {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: #e8c27d;
  font-weight: 600;
}

.finchi-modal__x {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 140, 0.25);
  background: transparent;
  color: #e8c27d;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.finchi-modal__x:hover {
  background: rgba(255, 215, 140, 0.12);
  transform: scale(1.05);
}

/* ---------- Body ---------- */
.finchi-modal__body {
  padding: 18px;
  display: grid;
  gap: 10px;

  /* a tartalom görget, nem az egész panel */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.finchi-modal__title {
  margin: 0 0 6px 0;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: #f1d99a;
}

/* ---------- Labels ---------- */
.finchi-modal__label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 215, 140, 0.9);
  margin-top: 8px;
}

/* ---------- Fields ---------- */
.finchi-modal__field {
  position: relative;
}

.finchi-modal__icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.7;
  pointer-events: none;
}

.finchi-modal__input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  border-radius: 12px; /* iOS override */
  font-size: 16px; /* iOS zoom FIX */
  line-height: 1.3;

  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.finchi-modal__input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 140, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.finchi-modal__input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.finchi-modal__input:focus {
  border-color: #e8c27d;
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- Hint ---------- */
.finchi-modal__hint {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* ---------- Footer ---------- */
.finchi-modal__footer {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  border-top: 1px solid rgba(255, 215, 140, 0.15);

  /* mindig látszik mobilon is */
  position: sticky;
  bottom: 0;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(10px);
}

/* ---------- Buttons ---------- */
.finchi-modal__btn {
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid rgba(255, 215, 140, 0.25);
  background: transparent;
  color: #ffffff;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.finchi-modal__btn {
  appearance: none;
  -webkit-appearance: none;

  font-family: inherit;
  line-height: 1;
  min-height: 44px; /* Apple HIG touch target */
}

.finchi-modal__panel {
  width: min(440px, 92vw);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 140, 0.18);
  background: linear-gradient(
    180deg,
    rgba(16, 16, 18, 0.96),
    rgba(10, 10, 12, 0.94)
  );
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);

  /* A modal magassága a VALÓS viewporthoz igazodik */
  max-height: calc(100vh - var(--fm-pad-top) - var(--fm-pad-bottom));
  display: flex;
  flex-direction: column;
}
@supports (height: 100dvh) {
  .finchi-modal__panel {
    max-height: calc(100dvh - var(--fm-pad-top) - var(--fm-pad-bottom));
  }
}

.finchi-modal__backdrop {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

body.finchi-modal-open {
  overflow: hidden;
  width: 100%;
}

.finchi-modal__btn--ghost {
  opacity: 0.85;
}

.finchi-modal__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.finchi-modal__btn--primary {
  background: linear-gradient(135deg, #1fa855, #25c36a);
  border-color: rgba(0, 0, 0, 0.2);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(37, 195, 106, 0.35);
}

.finchi-modal__btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(37, 195, 106, 0.45);
}

/* ---------- Error state ---------- */
.finchi-modal__input.is-error {
  border-color: #ff6b6b;
}

.finchi-modal__btn--messenger {
  background: linear-gradient(135deg, #0084ff, #1b74e4);
  border-color: rgba(0, 0, 0, 0.2);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 132, 255, 0.35);
}

.finchi-modal__btn--messenger:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(0, 132, 255, 0.45);
}

.finchi-modal__btn--messenger:hover {
  background: #006fe0;
}

@media (max-width: 520px) {
  .finchi-modal__footer {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "cancel cancel"
      "whatsapp messenger";
  }

  .finchi-modal__btn[data-fm-cancel] {
    grid-area: cancel;
  }

  .finchi-modal__btn[data-fm-ok] {
    grid-area: whatsapp;
  }

  .finchi-modal__btn[data-fm-messenger] {
    grid-area: messenger;
  }
}

.finchi-modal__copyhint {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.9;
  padding: 6px 8px 0;
}

.finchi-modal__copybox {
  grid-column: 1 / -1;
  text-align: center;
  padding: 10px 10px 0;
}

.finchi-modal__copytitle {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.finchi-modal__copyhint {
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.9;
  margin-bottom: 10px;
}

.finchi-modal__openMessenger {
  display: inline-block;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
}

/* =============================
   Messenger prompt mini modal
   ============================= */

.finchi-modal__panel--mini {
  max-width: 520px;
}

.finchi-modal__body--center {
  text-align: center;
}

.finchi-modal__footer--single {
  display: flex;
  justify-content: center;
}

.finchi-modal__footer--single .finchi-modal__btn {
  width: auto;
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.finchi-modal__btn--block {
  width: 100%;
  justify-content: center;
}

/* Ha modal nyitva van, a fix kosársáv ne takarja el a modal alját */
body.finchi-modal-open .finchi-cartbar {
  display: none;
}
